import java.util.Scanner;
class IllegalScoreException extends Exception{
	private String info = "IllegalScoreException: ";
	public IllegalScoreException(String info) {
		this.info = this.info + info ; 
	}
	@Override
	public String toString() {
		return info;
	}
	
}
class IllegalNameException extends Exception{
	private String info = "IllegalNameException: " ;
	public IllegalNameException(String info){
		this.info = this.info + info ;
	}
	public String toString (){
		return info ;
	}
}
class Student {
	private String name ;
	private int score ;
	public String toString() {
		return "Student [name=" + name + ", score=" + score + "]";
	}
	public String getName() {
		return name;
	}
	public void setName(String name) throws IllegalNameException{
		if(name.charAt(0)>='0'&&name.charAt(0)<='9')
			throw new IllegalNameException("the first char of name must not be digit, name="+name) ;
		this.name = name;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public int addScore(int score) throws IllegalScoreException{
		this.score = this.score + score ;
		if(this.score < 0 || this.score > 100){
			throw new IllegalScoreException("score out of range, score="+this.score) ;
		}
		return this.score ;
	}
}
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in) ;
		while(true){
			String str = sc.next() ;
			if("new".equals(str))
			{
				Student student = new Student() ;
				try{
					String name = sc.next() ;
					int score = sc.nextInt() ;
					
					student.setName( name ) ;
					student.addScore(score) ;
				}catch(IllegalNameException e){
					System.out.println(e.toString());;
					continue ;
				}catch(IllegalScoreException e){
					System.out.println(e.toString());
					continue ;
				}catch(Exception e){
					System.out.println("java.util.NoSuchElementException");
					continue ;
				}
				System.out.println(student.toString());
			}
			else
				break ;
		}
		sc.close(); 
		System.out.println("scanner closed");
	}
}
